﻿using System;

namespace Gaea
{
    /// <summary>
    /// 排除 - 该字段将不会有任何数据库操作
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class ExcludeAttribute : Attribute
    {

    }

    /// <summary>
    /// 主键
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class KeyAttribute : Attribute
    {

    }

    /// <summary>
    /// GaeaName
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class GaeaNameAttribute : Attribute
    {

        public GaeaNameAttribute(string name)
        {
            Name = name;
        }

        public string Name { get; set; }

        public GaeaNamePattern GaeaNamePattern { get; set; }

        public object[] Args { get; set; }
    }

    /// <summary>
    /// 多数据识别名
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class GaeaPowerOptionAttribute : Attribute, IGaeaOption
    {
        public GaeaPowerOptionAttribute(string Name)
        {
            ConnectionName = Name;
            ConnectionType = MultipleConnectionType.Special;
        }
        public string ConnectionName { get; set; }

        public MultipleConnectionType ConnectionType { get; set; }

        public string ConnectionString { get; set; }

        /// <summary>
        /// DbConnection的类型
        /// </summary>
        public Type TypeOfDbConnection { get; set; }

        /// <summary>
        /// GaeaPower的实现基础类
        /// </summary>
        public Type BaseTypeGaeaPower { get; set; }

        /// <summary>
        /// 防止数据库关键字符号
        /// </summary>
        public string[] GaeaNameSymbo { get; set; }
    }
}
